@extends('admin::layouts.master')
@section('content')
    <div class="card" id="app">
        <div class="card-header">客服组管理</div>
        <ul role="tablist" class="nav nav-tabs">
            <li class="nav-item"><a href="/admin/chatgroup" class="nav-link">客服组列表</a></li>
            <li class="nav-item"><a href="#" class="nav-link active">修改客服组</a></li>
        </ul>
        <form action="/admin/chatgroup/{{$chatgroup['id']}}" method="post">
            <div class="card-body card-body-contrast">
                @csrf @method('PUT')
                <div class="form-group row">
    <label for="sort" class="col-12 col-sm-3 col-form-label text-md-right">排序</label>
    <div class="col-12 col-md-9">
        <input id="sort" name="sort" type="text"
               value="{{ $chatgroup['sort']??old('sort') }}"
               class="form-control form-control-sm form-control{{ $errors->has('sort') ? ' is-invalid' : '' }}">
        @if ($errors->has('sort'))
            <span class="invalid-feedback" role="alert">
                <strong>{{ $errors->first('sort') }}</strong>
            </span>
        @endif
    </div>
</div>
<div class="form-group row">
    <label for="actived" class="col-12 col-sm-3 col-form-label text-md-right">用户组状态</label>
    <div class="col-12 col-md-9">
        <select id="actived" name="actived" class="form-control form-control-xs">
                       <option value="1"
            {{old('actived',$chatgroup['actived'])=='1'?'selected':''}} 
            >是</option>           <option value="2"
            {{old('actived',$chatgroup['actived'])=='2'?'selected':''}} 
            >否</option>
        </select>
        <br>
        @if ($errors->has('actived'))
            <span class="text-danger">
                <strong>{{ $errors->first('actived') }}</strong>
            </span>
        @endif
    </div>
</div>
<div class="form-group row">
    <label for="groupname" class="col-12 col-sm-3 col-form-label text-md-right">名称</label>
    <div class="col-12 col-md-9">
        <input id="groupname" name="groupname" type="text"
               value="{{ $chatgroup['groupname']??old('groupname') }}"
               class="form-control form-control-sm form-control{{ $errors->has('groupname') ? ' is-invalid' : '' }}">
        @if ($errors->has('groupname'))
            <span class="invalid-feedback" role="alert">
                <strong>{{ $errors->first('groupname') }}</strong>
            </span>
        @endif
    </div>
</div>
<div class="form-group row">
    <label for="groupname_en" class="col-12 col-sm-3 col-form-label text-md-right">英文名称</label>
    <div class="col-12 col-md-9">
        <input id="groupname_en" name="groupname_en" type="text"
               value="{{ $chatgroup['groupname_en']??old('groupname_en') }}"
               class="form-control form-control-sm form-control{{ $errors->has('groupname_en') ? ' is-invalid' : '' }}">
        @if ($errors->has('groupname_en'))
            <span class="invalid-feedback" role="alert">
                <strong>{{ $errors->first('groupname_en') }}</strong>
            </span>
        @endif
    </div>
</div>
<div class="form-group row">
    <label for="description" class="col-12 col-sm-3 col-form-label text-md-right">描述</label>
    <div class="col-12 col-md-9">
        <textarea id="description" name="description" rows="3"
                  class="form-control form-control{{ $errors->has('description') ? ' is-invalid' : '' }}">
            {{ $chatgroup['description']??old('description') }}</textarea>
        @if ($errors->has('description'))
            <span class="invalid-feedback" role="alert">
                <strong>{{ $errors->first('description') }}</strong>
            </span>
        @endif
    </div>
</div>

            </div>
            <div class="card-footer text-muted">
                <button class="btn btn-primary offset-sm-2">保存更新</button>
            </div>
        </form>
    </div>
@endsection
